using UnityEngine;
using System.Collections;

public class SpawnPointController: MonoBehaviour {
	public Transform m_BallPre;
	public Transform m_BigBallPre;
	public Transform m_DeathBall;
	float m_fImpluseForce = 1.0f;
	void OnDrawGizmos()
	{
		Gizmos.DrawIcon(transform.position, "decal_icon.png");
	}
	// Use this for initialization
	void Start () {
	
	}
	public void SpawnBigBall()
	{
		Transform Ball = Instantiate(m_BigBallPre, transform.position, Quaternion.identity) as Transform;
		Vector3 VecToCenter = GameObject.Find("Level").transform.position - transform.position;
		Ball.GetComponent<Rigidbody>().AddForce(VecToCenter * m_fImpluseForce, ForceMode.Impulse);
		Ball.renderer.material.color = Color.blue;
	}
	public void SpawnRegularBall()
	{
		Transform Ball = Instantiate(m_BallPre, transform.position, Quaternion.identity) as Transform;
		Vector3 VecToCenter = GameObject.Find("Level").transform.position - transform.position;
		Ball.GetComponent<Rigidbody>().AddForce(VecToCenter * m_fImpluseForce, ForceMode.Impulse);
		Ball.renderer.material.color = Color.green;
	}
	public void SpawnDeathBall()
	{
		Transform Ball = Instantiate(m_DeathBall, transform.position, Quaternion.identity) as Transform;
		Vector3 VecToCenter = GameObject.Find("Level").transform.position - transform.position;
		Ball.GetComponent<Rigidbody>().AddForce(VecToCenter * m_fImpluseForce * 0.5f, ForceMode.Impulse);
		Ball.tag = "DeathBall";
		Ball.renderer.material.color = Color.black;
	}
	// Update is called once per frame
	void Update () {
	
	}
}
